home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / tcl / porting.notes < prev    next >
Encoding:
Text File  |  1993-10-24  |  7.6 KB  |  202 lines  |  [TEXT/MPS ]

  1. This file contains a collection of notes that various people have
  2. provided about porting Tcl to various machines and operating systems.
  3. I don't have personal access to any of these machines, so I make
  4. no guarantees that the notes are correct, complete, or up-to-date.
  5. In some cases, a person has volunteered to act as a contact point
  6. for questions about porting Tcl to a particular machine;  in these
  7. cases the person's name and e-mail address are listed.
  8.  
  9. ---------------------------------------------
  10. Cray machines running UNICOS:
  11. Contact: John Freeman (jlf@cray.com)
  12. ---------------------------------------------
  13.  
  14. 1. There is an error in the strstr function in UNICOS such that if the
  15. string to be searched is empty (""), the search will continue past the
  16. end of the string.  Because of this, the history substitution loop
  17. will sometimes run past the end of its target string and trash
  18. malloc's free list, resulting in a core dump some time later.  (As you
  19. can probably guess, this took a while to diagnose.)  I've submitted a
  20. problem report to the C library maintainers, but in the meantime here
  21. is a workaround.
  22.  
  23. -----------------------------------------------------------------
  24. diff -c1 -r1.1 tclHistory.c
  25. *** 1.1    1991/11/12 16:01:58
  26. --- tclHistory.c    1991/11/12 16:14:22
  27. ***************
  28. *** 23,24 ****
  29. --- 23,29 ----
  30.   #include "tclInt.h"
  31. + #ifdef _CRAY
  32. + /* There is a bug in strstr in UNICOS; this works around it. */
  33. + #define strstr(s1,s2) ((s1)?(*(s1)?strstr((s1),(s2)):0):0)
  34. + #endif _CRAY
  35.  
  36. ---------------------------------------------
  37. MIPS systems runing EP/IX:
  38. ---------------------------------------------
  39.  
  40. 1. Need to add a line "#include <bsd/sys/time.h>" in tclUnix.h.
  41.  
  42. 2. Need to add "-lbsd" into the line that makes tclTest:
  43.  
  44.     ${CC} ${CFLAGS} tclTest.o libtcl.a -lbsd -o tclTest
  45.  
  46. ---------------------------------------------
  47. IBM RS/6000 systems running AIX:
  48. ---------------------------------------------
  49.  
  50. 1. The system version of strtoul is buggy, at least under some
  51. versions of AIX.  If the expression tests fail, try forcing Tcl
  52. to use its own version of strtoul instead of the system version.
  53. To do this, first copy strtoul.c from the compat subdirectory up
  54. to the main Tcl directory.  Then modify the Makefile so that
  55. the definition for COMPAT_OBJS includes "strtoul.o".  Note:  the
  56. "config" script should now detect the buggy strtoul and substitute
  57. Tcl's version automatically.
  58.  
  59. 2. You may have to comment out the declaration of open in tclUnix.h.
  60.  
  61. 3. You may need to add "-D_BSD -lbsd" to the CFLAGS definition.  This
  62. causes the system include files to look like BSD include files and
  63. causes C library routines to act like bsd library routines.  Without
  64. this, the system may choke on "struct wait".
  65.  
  66. ---------------------------------------------
  67. AT&T 4.03 OS:
  68. ---------------------------------------------
  69.  
  70. Machine: i386/33Mhz i387 32k Cache 16MByte 
  71. OS: AT&T SYSV Release 4 Version 3
  72. X: X11R5 fixlevel 9
  73. Xserver: X386 1.2
  74.  
  75. 1. Change the Tk Makefile as follows:
  76. XLIB            = -lX11
  77.     should be changed to:
  78. XLIB            = -lX11 -lsocket -lnsl
  79.  
  80. -------------------------------------------------------
  81. Silicon Graphics systems:
  82. -------------------------------------------------------
  83.  
  84. 1. Change the CC variable in the Makefile to:
  85.  
  86. CC =        cc -xansi -D__STDC__ -signed
  87.  
  88. 2. In  Irix releases 4.0.1 or earlier the C compiler has a buggy optimizer.
  89.    If Tcl fails its test suite or generates inexplicable errors,
  90.    compile tclVar.c with -O0 instead of -O.
  91.  
  92. 3. For IRIX 5.1 or later, comments 1 and 2 are no longer relevant,
  93. but you must add -D_BSD_SIGNALS to CFLAGS to get the proper signal
  94. routines.
  95.  
  96. ---------------------------------------------
  97. NeXT machines running NeXTStep 2.1 and 3.1:
  98. ---------------------------------------------
  99.  
  100. 1. Several of the "format" and "scan" tests will fail, but these are
  101. all minor nits stemming from imperfect POSIX compliance in the NeXT
  102. C library procedures.  The errors are unlikely to affect any Tcl
  103. applications.
  104.  
  105. 2. Some people have reported that the system version of "tmpnam"
  106. isn't reliable and that it's better to use the version in Tcl's
  107. "compat" directory.
  108.  
  109. -------------------------------------------------
  110. ISC 2.2 UNIX (using standard ATT SYSV compiler):
  111. -------------------------------------------------
  112.  
  113. In Makefile, change
  114.  
  115. CFLAGS =      -g -I. -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
  116.  
  117. to
  118.  
  119. CFLAGS =      -g -I. -DPOSIX_JC -DTCL_LIBRARY=\"${TCL_LIBRARY}\"
  120.  
  121. This brings in the typedef for pid_t, which is needed for
  122. /usr/include/sys/wait.h in tclUnix.h.
  123.  
  124. ---------------------------------------------
  125. DEC Alphas:
  126. ---------------------------------------------
  127.  
  128. 1. There appears to be a compiler/library bug that causes core-dumps
  129. unless you compile tclVar.c without optimization (remove the -O compiler
  130. switch).  The problem appears to have been fixed in the 1.3-4 version
  131. of the compiler.
  132.  
  133. ---------------------------------------------
  134. CDC 4680MNP, EP/IX 1.4.3:
  135. ---------------------------------------------
  136.  
  137. The installation was done in the System V environment (-systype sysv)
  138. with the BSD extensions available (-I/usr/include/bsd and -lbsd).  It was
  139. built with the 2.20 level C compiler.  The 2.11 level should not be used
  140. because it has a problem with detecting NaN values in lines like:
  141.     if (x != x) ...
  142. which appear in the TCL code.
  143.  
  144. To make the configure script find the BSD extensions, I set environment
  145. variable DEFS to "-I/usr/include/bsd" and LIBS to "-lbsd" before
  146. running it.  I would have also set CC to "cc2.20", but that compiler
  147. driver has a bug that loader errors (e.g. not finding a library routine,
  148. which the script uses to tell what is available) do not cause an error
  149. status to be returned to the shell.
  150.  
  151. There is a bug in the <sys/wait.h> include file that mis-defines the
  152. structure fields and causes WIFEXITED and WIFSIGNALED to return incorrect
  153. values.  My solution was to create a subdirectory "sys" of the main TCL
  154. source directory and put a corrected wait.h in it.  The "-I." already on
  155. all the compile lines causes it to be used instead of the system version.
  156. To fix this, compare the structure definition in /usr/include/bsd/sys/wait.h
  157. with /bsd43/include/sys/wait.h (or mail to John Jackson, jrj@cc.purdue.edu,
  158. and he'll send you a context diff).
  159.  
  160. After running configure, I made the following changes to Makefile:
  161.  
  162.     1)  In AC_FLAGS, change:
  163.         -DNO_WAIT3=1
  164.     to
  165.         -DNO_WAIT3=0 -Dwait3=wait2
  166.     EP/IX (in the System V environment) provides a wait2() system
  167.     call with what TCL needs (the WNOHANG flag).  The extra parameter
  168.     TCL passes to what it thinks is wait3() (the resources used by
  169.     the child process) is always zero and will be safely ignored.
  170.  
  171.     3)  Change:
  172.         CC=cc
  173.     to
  174.         CC=cc2.20
  175.     because of the NaN problem mentioned earlier.  Skip this if the
  176.     default compiler is already 2.20 (or later).
  177.  
  178.     4)  Add "-lbsd" to the commands that create tclsh and tcltest
  179.     (look for "-o").
  180.  
  181. ---------------------------------------------
  182. Convex systems, OS 10.1 and 10.2:
  183. Contact: Lennart Sorth (ls@dmi.min.dk)
  184. ---------------------------------------------
  185.  
  186. 1. tcl7.0b2 compiles on Convex systems (OS 10.1 and 10.2) by just running 
  187.   configure, typing make, except tclUnixUtil.c needs to be compiled
  188.   with option "-pcc" (portable cc, =!ANSI) due to:
  189.   cc: Error on line 1111 of tclUnixUtil.c: 'waitpid' redeclared:
  190.   incompatible types.
  191.  
  192.   -------------------------------------------------
  193. Pyramid, OSx 5.1a (UCB universe, GCC installed):
  194. -------------------------------------------------
  195.  
  196. The procedures memcpy, strchr, fmod, and strrchr are all missing,
  197. so you'll need to provide substitutes for them.  After you do that
  198. everything should compile fine.  There will be one error in a scan
  199. test, but it's an obscure one because of a non-ANSI implementation
  200. of sscanf on the machine;  you can ignore it.
  201.